/*
package com.jason.campusinn;

import android.graphics.Bitmap;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup.LayoutParams;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.jason.campusinn.view.TitleBar;


*/
/**
 * 带头标题的BaseActivity
 *
 * @author Administrator
 *//*

public abstract class TitleBarActivity extends BaseActivity {

    private View mParent;
    private TitleBar mActionBar;
    private LinearLayout mLayoutContent;
    private View mContent;

//    @Override
//    protected void onCreate(Bundle savedInstanceState) {
//        super.onCreate(savedInstanceState);
//        mParent = getLayoutInflater()
//                .inflate(R.layout.activity_actionbar, null);
//        mActionBar = (TitleBar) findViewById(R.id.actionbar);
//        mLayoutContent = (LinearLayout) findViewById(R.id.actionbar_content);
//        setActionBarFocusable(true);
//    }

    @Override
    public View findViewById(int id) {
        View view = mParent.findViewById(id);
        if (view == null) {
            return super.findViewById(id);
        }
        return view;
    }

    @Override
    public void setContentView(int layoutResID) {
        mContent = getLayoutInflater().inflate(layoutResID, null);
        mLayoutContent.addView(mContent,
                LinearLayout.LayoutParams.MATCH_PARENT,
                LinearLayout.LayoutParams.MATCH_PARENT);
        super.setContentView(mParent);
    }

    @Override
    public void setContentView(View view) {
        mContent = view;
        mLayoutContent.addView(mContent);
        super.setContentView(mParent);
    }

    @Override
    public void setContentView(View view, LayoutParams params) {
        mContent = view;
        mLayoutContent.addView(mContent, params);
        super.setContentView(mParent);
    }

    */
/**
     * 获取头标题
     *
     * @return
     *//*

    public TitleBar getDefaultActionBar() {
        return mActionBar;
    }

    */
/**
     * 获取标题view
     *
     * @return
     *//*

    public TextView getTitleView() {
        return mActionBar.getTitleView();
    }

    */
/**
     * 获取头标题的左视图
     *
     * @return
     *//*

    public ImageView getLeftView() {
        return mActionBar.getLeftView();
    }

    */
/**
     * 获取头标题的右视图
     *
     * @return
     *//*

    public ImageView getRightView() {
        return mActionBar.getRightView();
    }

    */
/**
     * 设置ActionBar是否获取焦点
     *
     * @param able
     *//*

    public void setActionBarFocusable(boolean able) {
        mActionBar.setFocusable(able);
        mActionBar.setFocusableInTouchMode(able);
        if (able) {
            mActionBar.requestFocus();
        } else {
            mActionBar.clearFocus();
        }
    }

    */
/**
     * 设置头标题左视图的图片资源
     *
     * @param resId
     *//*

    public void setLeftImageResource(int resId) {
        mActionBar.setLeftImageResource(resId);
    }

    */
/**
     * 设置头标题左视图的图片资源
     *
     * @param bitmap
     *//*

    public void setLeftImageBitmap(Bitmap bitmap) {
        mActionBar.setLeftImageBitmap(bitmap);
    }

    */
/**
     * 设置头标题左视图的图片资源
     *
     * @param drawable
     *//*

    public void setLeftImageDrawable(Drawable drawable) {
        mActionBar.setLeftImageDrawable(drawable);
    }

    */
/**
     * 设置头标题左视图是否可见
     *
     * @param visibility
     *//*

    public void setLeftVisibility(int visibility) {
        mActionBar.setLeftVisibility(visibility);
    }

    */
/*
     * 设置头标题的标题
     * (non-Javadoc)
     * @see android.app.Activity#setTitle(java.lang.CharSequence)
     *//*

    public void setTitle(CharSequence s) {
        mActionBar.setTitle(s);
    }

    */
/**
     * 设置标题是否可点击
     *
     * @param clickable
     *//*

    public void setTitleClickable(boolean clickable) {
        mActionBar.setTitleClickable(clickable);
    }

    */
/**
     * 设置标题左对齐
     *//*

    public void setTitleAlignLeft() {
        mActionBar.setTitleLeft();
    }

    */
/**
     * 设置标题居中
     *//*

    public void setTitleAlignCenter() {
        mActionBar.setTitleCenter();
    }


    */
/**
     * 设置头标题右视图的图片资源
     *
     * @param resId
     *//*

    public void setRightImageResource(int resId) {
        mActionBar.setRightImageResource(resId);
    }

    */
/**
     * 设置头标题右视图的图片资源
     *
     * @param bitmap
     *//*

    public void setRightImageBitmap(Bitmap bitmap) {
        mActionBar.setRightImageBitmap(bitmap);
    }

    */
/**
     * 设置头标题右视图的图片资源
     *
     * @param drawable
     *//*

    public void setRightImageDrawable(Drawable drawable) {
        mActionBar.setRightImageDrawable(drawable);
    }

    */
/**
     * 设置头标题右视图是否可见
     *
     * @param visibility
     *//*

    public void setRightVisibility(int visibility) {
        mActionBar.setRightVisibility(visibility);
    }

    */
/**
     * 设置右标题中文字是否可见
     *
     * @param visibility
     *//*

    public void setRightTextVisibility(int visibility) {
        mActionBar.setRightTextVisibility(visibility);
    }

    */
/**
     * 设置右标题文字内容
     *
     * @param content
     *//*

    public void setRightText(String content) {
        mActionBar.setRightText(content);
    }

    */
/**
     * 头标题左视图点击事件
     *
     * @param listener
     *//*

    public void setOnLeftClickListener(OnClickListener listener) {
        mActionBar.setOnLeftClickListener(listener);
    }

    */
/**
     * 标题点击事件
     *
     * @param listener
     *//*

    public void setOnTitleClickListener(OnClickListener listener) {
        mActionBar.setOnTitleClickListener(listener);
    }

    */
/**
     * 头标题右视图点击事件
     *
     * @param listener
     *//*

    public void setOnRightClickListener(OnClickListener listener) {
        mActionBar.setOnRightClickListener(listener);
    }

    public void setOnRightEnable(boolean enable) {
        mActionBar.setEnabled(enable);
        mActionBar.setClickable(enable);
    }
    public String phoneNumChange(String phoneNumber) {
        String number = phoneNumber.replaceAll("^(\\d{3})(\\d{4})(\\d{4})$", "$1****$3");
        return number;
    }
    public String emailNumberChange(String emailNumber){
//        String number = emailNumber.replaceAll("^(\\d{3})(\\d{4})(\\d{4})$", "$1****$3");
        String numbers[] = emailNumber.split("@");
        String header = numbers[0];
        String footer = "@"+numbers[1];

        String nameHeader = header.substring(0,2);
        String nameFooter = header.substring(header.length()-2);
        StringBuilder stringBuilder = new StringBuilder();
        for (int i = 0; i < header.length()-4; i++){
            stringBuilder.append("*");
        }
        String middle = stringBuilder.toString();
        header = nameHeader+middle+nameFooter;

        String number = header + footer;
        return number;
    }
}
*/
